package cn.shadow.aop.advisor;

import cn.shadow.aop.pointcut.AspectJExpressionPointcut;
import cn.shadow.aop.pointcut.Pointcut;

/**
 * AspectJ切点通知者
 * @author 冯啸迪
 */
public class AspectJPointcutAdvisor implements PointcutAdvisor{


    String advisorBeanName;

    AspectJExpressionPointcut pointcut;

    String expression;

    public AspectJPointcutAdvisor(String advisorBeanName, String expression){
        super();
        this.advisorBeanName = advisorBeanName;
        this.expression = expression;
        this.pointcut = new AspectJExpressionPointcut(expression);
    }

/*
* ======================================================================
*|                           PointcutAdvisor
*|
* ======================================================================
*/

    @Override
    public Pointcut getPointcut() {
        return pointcut;
    }

/*
*========================================================================
*|                           Advisor接口的相关实现
*|
*========================================================================
*/

    @Override
    public String getAdvisorBeanName() {
        return advisorBeanName;
    }

    @Override
    public String getExpression() {
        return expression;
    }
}
